package com.lineage.data.event;

import com.lineage.data.executor.EventExecutor;
import com.lineage.server.templates.L1Event;
import com.lineage.server.timecontroller.event.LeavesTime;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class LeavesSet extends EventExecutor {
  private static final Log _log = LogFactory.getLog(LeavesSet.class);
  
  public static boolean START = false;
  
  public static int TIME = 0;
  
  public static int EXP = 0;
  
  public static int MAXEXP = 400000;
  
  public static int MIN_LEVEL;
  
  public static EventExecutor get() {
    return new LeavesSet();
  }
  
  public void execute(L1Event event) {
    try {
      START = true;
      String[] set = event.get_eventother().split(",");
      try {
        TIME = Integer.parseInt(set[0]);
      } catch (Exception e2) {
        TIME = 15;
        _log.error("未设定时间(使用预设15分钟)");
      } 
      try {
        EXP = Integer.parseInt(set[1]);
      } catch (Exception e2) {
        EXP = 4000;
        _log.error("未设定增加的经验质(使用预设4000)");
      } 
      try {
        MIN_LEVEL = Integer.parseInt(set[2]);
      } catch (Exception e2) {
        MIN_LEVEL = 45;
        _log.error("未设定等级最少值(使用预设45)");
      } 
      MAXEXP = EXP * 200;
      LeavesTime leavesTime = new LeavesTime();
      leavesTime.start();
    } catch (Exception e) {
      _log.error(e.getLocalizedMessage(), e);
    } 
  }
}
